/*
 * @Author: your name
 * @Date: 2021-07-28 13:47:48
 * @LastEditTime: 2021-08-24 17:06:48
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \MF-workflow\src\components\fd\components\dataLink\api.ts
 */

import axios from 'axios';

export const uploadIpfs = async (formdata: FormData): Promise<any> => {
  try {
    const result = await axios.post(`/bk/uploadIpfs/workflow`, formdata);
    return result.data || {};
  } catch (error) {
    return {};
  }
};

export const getSource = async (url: string, data: any): Promise<any> => {
  try {
    const result = await axios.post(url, data);
    return result.data.result || { rows: [] };
  } catch (error) {
    return { rows: [] };
  }
};
